/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.sprd.systemui.util;

import android.app.ActivityDebugConfigs;
import android.util.Log;
import com.android.systemui.volume.D;
import com.android.systemui.power.PowerUI;
import com.android.systemui.stackdivider.Divider;

/* UNISOC:BUG 1153846 add for ActivityDebugConfigs feature */
public class SprdActivityDebugConfigsUtil {

    private static final String TAG = "SprdActivityDebugConfigsUtil";
    public static boolean DEBUG = false;
    public static boolean SPEW = false;
    public static boolean DUMPTRUCK = true;
    public static boolean DEBUG_GESTURES = false;
    public static boolean DEBUG_MEDIA_FAKE_ARTWORK = false;
    public static boolean DEBUG_CAMERA_LIFT = false;

    public static boolean DEBUG_WINDOW_STATE = false;
    public static boolean MULTIUSER_DEBUG = false;
    public static boolean CHATTY = false;

    public static boolean DEBUG_VOLUME = false;
    public static boolean DEBUG_POWERUI = false;

    public static boolean DEBUG_DIVIDER = false;

    public static final ActivityDebugConfigs.ConfigChangedListener mDebugListener =
                        new ActivityDebugConfigs.ConfigChangedListener() {
        @Override
        public void onDebugConfigChanged(ActivityDebugConfigs configs) {
            Log.d(TAG, "Receive DebugConfig: " + configs);

            if (configs == null || configs.getExtras() == null ||configs.getExtras().isEmpty()) {
                Log.d(TAG," onDebugConfigChanged null ");
                return;
            }

            DEBUG = configs.getExtras().getBoolean("DEBUG_DEBUG", false);
            SPEW = configs.getExtras().getBoolean("DEBUG_SPEW", false);
            CHATTY = configs.getExtras().getBoolean("DEBUG_CHATTY", false);
            DUMPTRUCK = configs.getExtras().getBoolean("DEBUG_DUMPTRUCK", true);
            DEBUG_MEDIA_FAKE_ARTWORK = configs.getExtras().getBoolean("DEBUG_MEDIA_FAKE_ARTWORK", false);
            DEBUG_CAMERA_LIFT = configs.getExtras().getBoolean("DEBUG_CAMERA_LIFT", false);
            DEBUG_WINDOW_STATE = configs.getExtras().getBoolean("DEBUG_WINDOW_STATE", false);
            MULTIUSER_DEBUG  = configs.getExtras().getBoolean("DEBUG_MULTIUSER ", false);

            DEBUG_VOLUME = configs.getExtras().getBoolean("DEBUG_VOLUME", false);
            D.setDebug(DEBUG_VOLUME);
            DEBUG_POWERUI = configs.getExtras().getBoolean("DEBUG_POWERUI", false);
            PowerUI.setDebug(DEBUG_POWERUI);

            DEBUG_DIVIDER = configs.getExtras().getBoolean("DEBUG_DIVIDER", false);
            Divider.setDebug(DEBUG_DIVIDER);

            //ActivityDebugConfigs.removeConfigChangedListener(this);
        }
    };

}
